Poking the FileSystem
In this lab, you will use assorted command line tools to examine some features of the file system on your devbox linux instances.   You may work with a partner for this lab.  There is no extra work for graduate students -- just complete the lab as specified.
Getting Started:
In this lab, we will be using the following tools:
od: od stands for "octal dump".  It is a tool that can dump the contents of data files (as compared to text files). By default, it dumps the file bytes in octal (hence the name), but switches exist to enable it to dump the file as characters, decimal or hexadecimal values.  For more information, google "man od"
debugfs: a linux tool that allows you to inspect file system structures for ext filesystems.  You can find a man page here: https://linux.die.net/man/8/debugfs
find: a tool that can recursively search for files
ls: "list files"
Follow the steps below, and answer all questions in a text lab document.  This document will be your submission for the lab.  You may submit 1 file for yourself and your partner -- just be sure to clearly identify all people working together.  Only one of each group needs to submit a file.

Steps:
1. Log onto your devbox instance
2. In your /home/student directory (the default home directory), perform the following commands:
# mkdir test
# touch test/XXXX
3. What did the commands in the previous step do?
4. Perform the following commands, and record the results in your lab document, and explain the fields in the outputs.  Use man ls if you need information about the options to the ls command:

# ls -ldi test
# ls -li test
5. Next, use debugfs to examine the file system.  In order to proceed, you will need the inode number for both the file XXXX and the directory test:

# sudo debugfs /dev/sda1
debugfs: stat <inode for file XXXX>      /// this will be something like <531505> .  You do include the <> around the inode number.

From the output, how many blocks are in your file?  What does the type field mean?  and the mode?
 type q to return to the debugfs prompt:

debugfs: stat <inode for directory test>
Examine the output, and observe the differences between this directory inode, and the file inode.

debugfs: dump <inode for directory test>  test.out
debugfs: quit
6. The previous command (dump <inode> test.out) created a new file named test.out in your directory with the contents of the inode for the test directory.  Perform these commands:

# od -c test.out
# od -D test.out
The first command dumps the file as characters, and the second dumps it out as decimal ints.  Examine the results.  Recall that directory inodes contain the mappings from file names to inode numbers for all the directory . (the current directory), the directory ..  (the parent directory) and all files included in the directory.  The problem is that while the od -c output lets you see the names of the files, you can't find the inode numbers.  The od -D will let you find the inodes, but not which file they correspond to.  Looking at the -c output, identify where you think the inode numbers must be in the output, and then look at the -D output to confirm your guess.  You can compare your guess to the previous commands you've performed.

Include the od -c and od -D output in your lab document.

7. In your od -D output, you should be able to identify 3 inode numbers.   For each inode, identify the file that it corresponds to.  For each inode number perform the following command:

# find /home/student -inum XXXXXX -exec ls -li {} \;
where XXXXX is one of the inode numbers you found.  For two of the three commands, you will want to do "exec ls -ldi" and the other one you'll want to do "exec ls -li"   Explain the results, and explain why the results are expected based on your od -c results.   Include the output of the three commands and your explanation in your lab document.

8.  Add some content to the XXXX file you created in step 2:

# echo "This is some stuff to put in the file it can be anything you want it to be, just make sure it goes on a bit" > test/XXXX
9. Restart debugfs and:
debugfs:  stat <inode of XXXX>
Explain the values of the four times listed in the inode.  Why are some different from the others?

debugfs: cat <inode of XXXX>
What does this command do?

10. If you have any remaining time, look through the debugfs man page, and pick another command to experiment with.  Document your tests and the results.

11. Submit your lab document, and you are done!